package com.example.myyunpan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.myyunpan.entity.domain.UserInfo;
import com.example.myyunpan.entity.query.UserInfoQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 111
* @description 针对表【user_info(用户信息)】的数据库操作Mapper
* @createDate 2024-10-23 11:41:27
* @Entity com/example/myyunpan.domain.UserInfo
*/
@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    UserInfo selectByEmailUserInfo(String email);

    UserInfo selectByNickNameUserInfo(String nickName);

//    TODO 有问题
    void updateByUserId(@Param("bean") UserInfo updateInfo,@Param("userId") String userId);

    void updateByEmailUserInfo(@Param("bean") UserInfo updateInfo,@Param("email") String email);

    Integer updateUserSpace(@Param("userId") String userId, @Param("useSpace") Long useSpace, @Param("totalSpace") Long totalSpace);

    int findCountByParam(UserInfoQuery query);

    int selectCount(@Param("query") UserInfoQuery query);

    List<UserInfo> selectList(@Param("query") UserInfoQuery query);

    UserInfo selectByUserId(String cureentUserId);

    UserInfo selectByQqOpenId(String qqOpenId);

    void updateByQqOpenId(@Param("bean") UserInfo updateInfo, String qqOpenId);
}
